﻿<%@ Page Title="" Language="C#" MasterPageFile="~/List.Master" AutoEventWireup="true" 
    CodeBehind="UserList.aspx.cs" Inherits="SGDemo.Permission.UserList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cpHeader" runat="server">
    <script src="UserList.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpBody" runat="server">
    <div class="ui-menu">
        <uc:Menu ID="menu1" runat="server" DataFile="../Views/Permission/Menu/UserList.xml"
            PageCode="UserList" />
    </div>
    <div class="ui-wrapper">
        <div id="listall" class="ui-content-item ui-content-item-selected">
            <%--gvwList--%>
            <dx:ASPxGridView ID="gvwList" ClientInstanceName="gvwList" runat="server" AutoGenerateColumns="False"
                DataSourceForceStandardPaging="True" DataSourceID="odsList" Width="100%" KeyFieldName="Keyid"
                OnCustomCallback="gvwList_CustomCallback">
                <Columns>
                    <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" HeaderStyle-HorizontalAlign="Center">
                        <HeaderTemplate>
                            <dx:ASPxCheckBox ID="cbSelectAll" runat="server">
                                <ClientSideEvents CheckedChanged="doSelectOrUnselectAll" />
                            </dx:ASPxCheckBox>
                        </HeaderTemplate>
                    </dx:GridViewCommandColumn>
                    <dx:GridViewDataColumn Caption="用户名" FieldName="Username" VisibleIndex="1">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="真实姓名" FieldName="Realname" VisibleIndex="2">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="邮箱地址" FieldName="Email" VisibleIndex="3">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="手机号码" FieldName="MobilePhone" VisibleIndex="4">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="所在部门" FieldName="DeptName" VisibleIndex="5">
                    </dx:GridViewDataColumn>

                    <dx:GridViewDataCheckColumn FieldName="IsApproved" VisibleIndex="6" Caption="是否审核"
                        Settings-AllowSort="False" HeaderStyle-HorizontalAlign="Center">
                        <PropertiesCheckEdit DisplayTextChecked="true" DisplayTextUnchecked="false" />
                    </dx:GridViewDataCheckColumn>
                    <dx:GridViewDataCheckColumn FieldName="IsLockedOut" VisibleIndex="7" Caption="是否禁用"
                        Settings-AllowSort="False" HeaderStyle-HorizontalAlign="Center">
                        <PropertiesCheckEdit DisplayTextChecked="true" DisplayTextUnchecked="false" />
                    </dx:GridViewDataCheckColumn>
                    <dx:GridViewDataColumn Caption="创建日期" FieldName="CreateDate" VisibleIndex="8">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="创建人" FieldName="CreateName" VisibleIndex="9">
                    </dx:GridViewDataColumn>
                </Columns>
                <ClientSideEvents SelectionChanged="doSelectionChanged" RowDblClick="doRowDblClick" />
                <SettingsBehavior AllowFocusedRow="true" />
                <SettingsLoadingPanel Text="加载中..." />
                <SettingsPager PageSize="15" Mode="ShowPager" Summary-Text="当前第{0}页，共{1}页(共{2}条)">
                </SettingsPager>
                <SettingsText EmptyDataRow="没有数据显示" />
            </dx:ASPxGridView>
            <%--数据源控件--%>
            <asp:ObjectDataSource ID="odsList" runat="server" SortParameterName="sortColumns"
                EnablePaging="true" StartRowIndexParameterName="startRecord" MaximumRowsParameterName="maxRecords"
                SelectCountMethod="PagingGetUserCount" SelectMethod="PagingGetUser" TypeName="SGDemo.Permission.UserManage">
                <SelectParameters>
                    <asp:ControlParameter Name="filterConditions" Type="String" ControlID="hfFilterCondition"
                        PropertyName="Value" ConvertEmptyStringToNull="false" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <%--存储过滤条件--%>
            <asp:HiddenField ID="hfFilterCondition" ClientIDMode="Static" runat="server" Value=" " />
            <%--GridView数据导出--%>
            <dx:ASPxGridViewExporter ID="gvweList" GridViewID="gvwList" runat="server"
                FileName="用户列表">
            </dx:ASPxGridViewExporter>
        </div>
        <div id="search" class="ui-content-item">
            <ul class="ui-list">
                <li>
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="用户名：" AssociatedControlID="txtUsername" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtUsername" ClientInstanceName="txtUsername" runat="server"
                        Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel7" runat="server" Text="真实姓名：" AssociatedControlID="txtRealname" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtRealname" ClientInstanceName="txtRealname" runat="server"
                        Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="邮箱地址：" AssociatedControlID="txtEmail" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtEmail" ClientInstanceName="txtEmail" runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="lblPhone" runat="server" Text="手机号码：" AssociatedControlID="txtMobilePhone" />
                </li>
                <li>
                    <dx:ASPxSpinEdit ID="seMobilePhone" ClientInstanceName="seMobilePhone" runat="server"
                        MaxLength="11" Width="120">
                        <SpinButtons ShowIncrementButtons="False" ShowLargeIncrementButtons="False" />
                    </dx:ASPxSpinEdit>
                </li>
               
            </ul>
            <ul class="ui-list">
                <li>
                    <dx:ASPxLabel ID="lblEmail2" runat="server" Text="是否审核：" />
                </li>
                <li>
                    <dx:ASPxRadioButtonList ID="rblIsApproved" ClientInstanceName="rblIsApproved" runat="server"
                        RepeatDirection="Horizontal" RepeatLayout="Table" Width="120">
                        <Items>
                            <dx:ListEditItem Text="是" Value="true" />
                            <dx:ListEditItem Text="否" Value="false" />
                        </Items>
                        <Paddings Padding="0" />
                    </dx:ASPxRadioButtonList>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel12" runat="server" Text="是否禁用：" />
                </li>
                <li>
                    <dx:ASPxRadioButtonList ID="rblIsLockedOut" ClientInstanceName="rblIsLockedOut" runat="server"
                        RepeatDirection="Horizontal" RepeatLayout="Table" Width="120">
                        <Items>
                            <dx:ListEditItem Text="是" Value="true" />
                            <dx:ListEditItem Text="否" Value="false" />
                        </Items>
                        <Paddings Padding="0" />
                    </dx:ASPxRadioButtonList>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel22" runat="server" Text="创建日期：" AssociatedControlID="deCreateDate" />
                </li>
                <li>
                    <dx:ASPxDateEdit ID="deCreateDate" ClientInstanceName="deCreateDate" runat="server"
                        Width="120px" EditFormatString="yyyy-MM-dd">
                    </dx:ASPxDateEdit>
                </li>
                 <li>
                    <dx:ASPxLabel ID="lblDeptName" runat="server" Text="所在部门：" AssociatedControlID="txtDeptName" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtDeptName" ClientInstanceName="txtDeptName" runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
            </ul>
            <ul class="sl-floatcenter clearfix">
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="btnSubmit" ClientInstanceName="btnSubmit" runat="server" Text="查 询"
                        AutoPostBack="false">
                        <ClientSideEvents Click="doSubmittedToSearch" />
                    </dx:ASPxButton>
                </li>
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="btnReset" ClientInstanceName="btnReset" runat="server" Text="重 置"
                        AutoPostBack="false">
                        <ClientSideEvents Click="doResetToSearch" />
                    </dx:ASPxButton>
                </li>
            </ul>
        </div>
        <div id="bulkupdate" class="ui-content-item">
            <ul class="ui-list">
                <li>
                    <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="用户编码：" AssociatedControlID="txtCode" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="用户名称：" AssociatedControlID="txtUsername" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="ASPxTextBox3" runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel5" runat="server" Text="邮箱地址：" AssociatedControlID="txtEmail" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="ASPxTextBox4" runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="手机号码：" AssociatedControlID="txtPhone" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="ASPxTextBox5" runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
            </ul>
            <ul class="sl-floatcenter clearfix">
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="ASPxButton2" runat="server" Text="确 定" />
                </li>
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="ASPxButton3" runat="server" Text="重 置" />
                </li>
            </ul>
        </div>
        <div id="fixedquery" class="ui-content-item">
            <ul>
                <li><a href="javascript:doFixedQueryToRun('A');">查询已审核通过的用户</a></li>
                <li><a href="javascript:doFixedQueryToRun('B');">查询已被禁用的用户</a></li>
                <li><a href="javascript:doFixedQueryToRun('C');">查询使用网易(@163.com)邮箱的用户</a></li>
                <li><a href="javascript:doFixedQueryToRun('D');">查询姓名是“李”的用户</a></li>
                <li><a href="javascript:doFixedQueryToRun('E');">查询由系统管理员添加的用户</a></li>
            </ul>
        </div>
        <%--导出数据--%>
        <dx:ASPxPopupControl ID="pcExport" ClientInstanceName="pcExport" runat="server" CloseAction="CloseButton"
            LoadContentViaCallback="OnFirstShow" PopupVerticalAlign="WindowCenter" PopupHorizontalAlign="WindowCenter"
            AllowDragging="True" Width="320" Height="200" Modal="true" LoadingPanelText="加载中..."
            HeaderText="导出数据" EnableViewState="False">
            <ContentCollection>
                <dx:PopupControlContentControl ID="pcExportContent" runat="server">
                    <div id="exportDialog">
                        <ul class="ui-list-vertical">
                            <li>
                                <dx:ASPxButton ID="btnExportXls" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Xls" Text="Xls文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportXlsx" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Xlsx" Text="Xlsx文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportPdf" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Pdf" Text="Pdf文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportCsv" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Csv" Text="Csv文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportRtf" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Rtf" Text="Rtf文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                        </ul>
                        <ul class="sl-floatcenter clearfix">
                            <li class="sl-floatcenter-item">
                                <dx:ASPxButton ID="btnCloseToExport" ClientInstanceName="btnCloseToExport" runat="server"
                                    AutoPostBack="False" Text="关 闭">
                                    <ClientSideEvents Click="doCloseToExport" />
                                </dx:ASPxButton>
                            </li>
                        </ul>
                    </div>
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxPopupControl>
    </div>
</asp:Content>
